package online.inote.common.shiro;

import org.apache.shiro.cache.AbstractCacheManager;
import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheException;
import org.springframework.data.redis.core.RedisTemplate;

/**
 * <p>
 * Desc:
 * </p>
 *
 * @author XQF SUI
 * @created 2018年8月25日 下午8:14:32
 * @version 1.0
 */
@SuppressWarnings("rawtypes")
public class ShiroRedisCacheManager extends AbstractCacheManager {

	private RedisTemplate redisTemplate;

	public ShiroRedisCacheManager(RedisTemplate redisTemplate) {
		this.redisTemplate = redisTemplate;
	}

	@Override
	protected Cache createCache(String name) throws CacheException {
		return new ShiroRedisCache(redisTemplate, name);
	}
}